package org.clockworkmages.games.anno1186.gui;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import org.clockworkmages.games.anno1186.model.option.Option;

public class OptionTextInputKeyListener implements KeyListener {

	private Option option;

	@Override
	public void keyTyped(KeyEvent e) {
	}

	@Override
	public void keyReleased(KeyEvent e) {
	}

	@Override
	public void keyPressed(KeyEvent e) {
		int key = e.getKeyCode();
		if (key == KeyEvent.VK_ENTER) {
			option.select();
		}
	}

	public Option getOption() {
		return option;
	}

	public void setOption(Option option) {
		this.option = option;
	}

}
